package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.dao.UserMapper;
import com.woniuxy.pojo.User;
import com.woniuxy.service.UserService;
@Transactional
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	@Override
	public List<User> getAllUsers() {
		// TODO Auto-generated method stub
		
		return userMapper.selectAllUsers();
	}
	@Override
	public User isExist(String telephone, String password) {
		// TODO Auto-generated method stub
		return userMapper.selectUserByPhoneAndPwd(telephone, password);
	}
	@Override
	public void addUser(User user) {
		// TODO Auto-generated method stub
		user.setPassword("123456");
		user.setAvailable(1);
		userMapper.saveUser(user);
	}
  
	
}
